using System;
using System.Collections.Generic;
using System.ByteBuffer;
using tools;

namespace Zjh
{
    /// <summary>
    /// generate by msg tool
    /// 看牌结果
    /// </summary>
	public class ResSeeCardMsg : ResMessage
	{
		//牌型(0:235,1:单张,2:对子,3:顺子,4:金华,5:顺金,6:豹子)
		public int cardsType;
		//牌
		public List<int> cards = new List<int>();
		

        public ResSeeCardMsg() { }

        public ResSeeCardMsg(int cardsType)
        {
            this.cardsType = cardsType;
        }

        
		public void write(object obj)
		{
            ByteBuffer b = obj as ByteBuffer;
			b.PushInt(cardsType);
			b.PushInt(cards.Count);

			foreach (var element in cards)
			{
				b.PushInt(element);
				
			}
			
		}

	    public void read(object obj)
		{
            MyConverter b = obj as MyConverter;
			cardsType = b.toInt32();
			int cards_length = b.toInt32();
			for (int i = 0; i < cards_length; ++i)
			{
				cards.Add(b.toInt32());
				
			}
			
		}

		public int Id
		{
            get { return 519221; }
		}

        public String Desc
        {
            get { return "看牌结果"; }
        }
	}
}